package org.example.common;


/**
 * @author  chengxuan
 * @date  2021/4/8 9:37
 */
public enum BaseWarehouseSysTypeEnum {

    OTHER(0,"", false,true,""),
    COPE(1, "COPE",false,true,"COPE仓库(不同于YQN_COPE)")
    ;

    private Integer type;
    private String code;
    private Boolean isNeedCheck;
    /** 订单和面单是否同一个接口 */
    private Boolean orderAndLabelSameInterface;
    private String desc;

    BaseWarehouseSysTypeEnum(Integer type, String code, Boolean isNeedCheck, Boolean orderAndLabelSameInterface, String desc){
            this.type = type;
            this.code = code;
            this.isNeedCheck = isNeedCheck;
            this.orderAndLabelSameInterface = orderAndLabelSameInterface;
            this.desc = desc;
    }

    public static BaseWarehouseSysTypeEnum getByCode(String code) {
        if(code==null){
            return OTHER;
        }
        for (BaseWarehouseSysTypeEnum baseWarehouseSysTypeEnum : values()) {
            if (baseWarehouseSysTypeEnum.code.equalsIgnoreCase(code)) {
                return baseWarehouseSysTypeEnum;
            }
        }
        return OTHER;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Boolean getNeedCheck() {
        return isNeedCheck;
    }

    public void setNeedCheck(Boolean needCheck) {
        isNeedCheck = needCheck;
    }

    public Boolean getOrderAndLabelSameInterface() {
        return orderAndLabelSameInterface;
    }

    public void setOrderAndLabelSameInterface(Boolean orderAndLabelSameInterface) {
        this.orderAndLabelSameInterface = orderAndLabelSameInterface;
    }
}
